<?php

class Usuario extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->model('usuario_model');
    }

    public function index() {
        
    }

    /*
      public function view($slug)
      {
      $data['usuario_item'] = $this->usuario_model->get_usuario($slug);

      if (empty($data['usuario_item']))
      {
      show_404();
      }

      $data['cedula'] = $data['usuario_item']['cedula'];

      $this->load->view('templates/header', $data);
      $this->load->view('news/view', $data);
      $this->load->view('templates/footer');
      }
     */

    public function create() {
        $this->load->helper('form');
        $this->load->library('form_validation');

        $this->form_validation->set_rules('cedula', 'Cedula', 'required');

        if ($this->form_validation->run() === FALSE) {
            $this->load->view('templates/header');
            $this->load->view('usuario/create');
            $this->load->view('templates/footer');
        } else {
            $this->usuario_model->insert_usuario();
            //$this->load->view('news/success');
        }
    }

}